package fx.iog.welcome;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import fx.iog.gen.R;

@SuppressLint("InflateParams")
public class LoginDialog extends DialogFragment implements OnClickListener {

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		LayoutInflater inflater = getActivity().getLayoutInflater();
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

		// builder.setTitle("Login")
		builder.setPositiveButton("Logar", this)
				.setNegativeButton("Criar Conta", this)
				.setNeutralButton("Esqueci a senha", this);

		builder.setView(inflater.inflate(R.layout.dialog_login, null));

		builder.setCustomTitle(getView());

		AlertDialog dialog = builder.create();
		
		return dialog;
	}

	@Override
	public void onClick(DialogInterface dialog, int which) {
		// TODO Auto-generated method stub

		if (which == DialogInterface.BUTTON_NEGATIVE) {
			Intent intent = new Intent(getActivity(),
					SltPerfilCreateActivity.class);
			startActivity(intent);
		}

	}

}
